demo: Use constraint guide api
authorMatthias Clasen <mclasen@redhat.com>
Thu, 27 Jun 2019 22:06:53 +0000 (22:06 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Sun, 30 Jun 2019 23:10:11 +0000 (00:10 +0100)
Use proper api to create and set up
the guide, and also try max-width.

demos/gtk-demo/constraints.c

index f48cbb8baccb39384b693398d8dade203755d2b1..974681a82de8b68298a0058b213f97fa69f4c54e 100644 (file)
@@ -76,12 +76,10 @@ build_constraints (SimpleGrid          *self,
 {
   GtkConstraintGuide *guide;
 
-  guide = g_object_new (GTK_TYPE_CONSTRAINT_GUIDE,
-                        "min-width", 10,
-                        "min-height", 10,
-                        "nat-width", 100,
-                        "nat-height", 10,
-                        NULL);
+  guide = gtk_constraint_guide_new ();
+  gtk_constraint_guide_set_min_size (guide, 10, 10);
+  gtk_constraint_guide_set_nat_size (guide, 100, 10);
+  gtk_constraint_guide_set_max_size (guide, 200, 20);
   gtk_constraint_layout_add_guide (manager, guide);
 
   gtk_constraint_layout_add_constraint (manager,